<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>管理员管理<!--{if $info['name']}-->--{$info['name']}<!--{/if}--></title>
        <link href="style/default.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="./javascript/jquery.js">
        </script>
        <script type="text/javascript" src="./javascript/javascript.js">
        </script>
        <script type="text/javascript">
			var method = eval('({Action_getMethodJson:true})');
            $(function(){
                $('select[name="sort_id"]').click(function(){
                    $('input:radio[name="sort"]').eq(2).attr('checked', true);
                });
				for(var model in method) {
					$('select[name="model"]').append('<option>'+model+'</option>');
				}
				getMethodSelect();
            });
			function getMethodSelect(){
				var model = $('select[name="model"]').val();
				$('select[name="method"]').html('');
				for(var i in method[model]) {
					$('select[name="method"]').append('<option>'+method[model][i]+'</option>');
				}
			}
        </script>
    </head>
    <body>
        <!--{include nav.html}-->
        <div id="main">
            <div style="float:left;">
                <table class="list">
                    <tr>
                        <th>
                            管理员名
                        </th>
                        <th>
                             所属省
                        </th>
                        <th>
                            所属城市
                        </th>
                        <th>
                            最后登录时间
                        </th>
                        <th>
                            最后登录IP
                        </th>
                        <th width="30">
                            状态
                        </th>
                        <th class="but">
                            <a href="{$url}&amp;m=add"><img src="images/new.gif"></a>
                        </th>
                    </tr>
                    <form method="post">
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td>
                                <!--{Html_getSelect_lib:array(''=>'全部','active'=>'正常','close'=>'关闭'),$_GET['status'],array('name'=>'status')}-->
                            </td>
                            <td align="center">
                                <input type="submit" name="filter" value="过滤">
                            </td>
                        </tr>
                    </form><!--{foreach $list['data'] $row}-->
                    <tr id="list_{$row['id']}" {if $row['id']==$_GET['id']}class="selected"{/if}>
                        <td>
							<!--{$row['name']}-->
                        </td>
                        <td>
							<!--{$row['state']}-->
                        </td>
                        <td>
							<!--{$row['city']}-->
                        </td>
                        <td nowrap>
							<!--{echo date('y-m-d H:i:s', $row['last_login_time'])}-->
                        </td>
                        <td align="center">
							<!--{echo long2ip($row['last_login_ip'])}-->
                        </td>
                        <td align="center">
							<!--{$row['status_value']}-->
						</td>
                        <td class="but" align="center">
                            <!--{if $row['is_sigle']=='no'}--><a href="{$url}&amp;m=add&id={$row['id']}"><img src="images/new.gif"></a><!--{/if}-->
							<a href="{$url}&m=edit&id={$row['id']}"><img src="images/edit.gif"></a>
							<a href="{$url}&m=del&id={$row['id']}"><img src="images/delete.gif"></a>
                        </td>
                    </tr><!--{/foreach}-->
                </table>
				<div>
                    {$mulitpage}
                </div>
            </div>
            <div style="float:left;margin-left:5px;">
                <form method="post" action="{$url}&amp;m={$_GET['m']}&amp;id={$_GET['id']}">
                    <table class="list">
                        <tr>
                            <th colspan="2">
                                <!--{if $_GET['m']=='edit'}-->修改<!--{elseif $_GET['m']=='del'}-->删除<!--{else}--> 增加<!--{/if}--> 管理员
                            </th>
                        </tr>
                        <!--{if $_GET['m']=='del'}-->
                        <tr>
                            <td align="center" colspan="2">
                                确认真的要删除<b>{$info['name']}</b>管理员
                                <br>
                                <span class="error">删除后该管理员的信息将不能恢复</span>
                            </td>
                        </tr>
                        <tr>
                            <th colspan="2">
                                <input type="submit" name="confirm" value="删除"><input type="submit" name="cancel" value="取消">
                            </th>
                        </tr><!--{else}-->
                        <tr>
                            <th>
                                管理员名
                            </th>
                            <td>
                                <input type="text" name="name" value="{$info['name']}" class="short">
                            </td>
                        </tr>
                        <tr>
                            <th>
                                密码
                            </th>
                            <td>
								<input type="password" name="password">
                            </td>
                        </tr>
						<tr>
                            <th>
                                所属省
                            </th>
                            <td>
                                <!--{Html_getSelect_lib:$state_select,$info['state'],array('name'=>'state'),array(''=>'全部')}-->
                            </td>
                        </tr>
						<tr>
                            <th>
                                所属城市
                            </th>
                            <td>
                                <!--{Html_getSelect_lib:$city_select,$info['loc_id'],array('name'=>'loc_id'),array('全部')}-->
                            </td>
                        </tr>
						<tr>
                            <th>
                                状态
                            </th>
                            <td>
                                <!--{Html_getSelect_lib:array('active'=>'正常','close'=>'关闭'),$info['status'],array('name'=>'status')}-->
                            </td>
                        </tr>
						<tr>
							<th>
								权限
							</th>
							<td>
								<table class="list">
									<!--{foreach $privilegeList $privilegeRow}-->
									<tr>
										<td><input type="checkbox" name="privilege[]" value="{$privilegeRow['id']}" {if array_key_exists($privilegeRow['id'],$info['privilege'])}checked{/if}></td>
										<td>{$privilegeRow['name']}</td>
									</tr>
									<!--{/foreach}-->
								</table>
							</td>
						</tr>
						<!--{if $sa}-->
						<tr>
							<th>
								授权
							</th>
							<td>
								<table class="list">
									<!--{foreach $privilegeList $privilegeRow}-->
									<tr>
										<td><input type="checkbox" name="authorize[]" value="{$privilegeRow['id']}" {if array_key_exists($privilegeRow['id'],$info['authorize'])}checked{/if}></td>
										<td>{$privilegeRow['name']}</td>
									</tr>
									<!--{/foreach}-->
								</table>
							</td>
						</tr>
						<!--{/if}-->
                        <tr>
                            <th colspan="2">
                                <input type="submit" name="save" value="保存">
								<input type="submit" name="apply" value="应用">
								<input type="submit" name="cancel" value="取消">
								<!--{if $_GET['m']=='edit'}--><input type="submit" name="del" value="删除"><!--{/if}-->
                            </th>
                        </tr><!--{/if}-->
                    </table>
                </form>
            </div>
        </div>
    </body>
</html>